package any;

public class ExceptionExample {
    public static void main(String[] args) {
        System.out.println(checkCatch());
    }

    static int checkCatch() {
        int a;
        try {
            check(-1);
            a = 1;
            return 1;
        } catch (IllegalArgumentException e) {
            System.out.println("xxxx");
        } finally {
            a = 2;
        }
        return a;
    }

    static void check(int num) {
        if (num < 0)
            throw new IllegalArgumentException();
    }
}
